package com.hengpeng.itfinbase.persist;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import com.hengpeng.itfinbase.idAssign.AbstractAssign18IdEntity;

/**
 * <pre>
 * 发送含校验号的业务邮件
 * </pre>
 * @author zhaojitao
 * @version 1.0, 2010-12-2
 */
@Entity
public class VerifyCode extends AbstractAssign18IdEntity
{

	public static enum VerifyType
	{
		/**
		 * 找回网上提现密码
		 */
		FOUNDACCOUNTPWD("找回网上提现密码"),
		/**
		 * 找回登录密码
		 */
		FOUNDLOGINPWD("找回登录密码"),
		/**
		 * 注册
		 */
		REGISTER("注册"),
		/**
		 * 订阅邮件
		 */
		SUBSCRIBE("邮件订阅"),
		/**
		 * 邮箱验证
		 */
		VALIDEMAIL("邮箱验证"),
		/**
		 * 手机验证
		 */
		VALIDMOBILE("手机验证");

		private String text;

		VerifyType(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	private static final long serialVersionUID = 1L;

	/**
	 * 用户名
	 */
	private String userName;

	/**
	 * 创建时间
	 */
	private Date createDate;

	/**
	 * 过期时间
	 */
	private Date pastDate;

	/**
	 * 类型
	 */
	@Column(length = 20)
	@Enumerated(javax.persistence.EnumType.STRING)
	private VerifyType type;

	/**
	 * 有效性
	 */
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue valid;

	/**
	 * 校验码(生成规则 yyyyMMddHHmmss+MD5(10位随机数))
	 */
	@Column(length = 50)
	private String value;

	/**
	 * 手机
	 */
	private String mobile;

	public String getMobile()
	{
		return mobile;
	}

	public void setMobile(String mobile)
	{
		this.mobile = mobile;
	}

	public Date getCreateDate()
	{
		return createDate;
	}

	public Date getPastDate()
	{
		return pastDate;
	}

	public VerifyType getType()
	{
		return type;
	}

	public BoolValue getValid()
	{
		return valid;
	}

	public String getValue()
	{
		return value;
	}

	public void setCreateDate(Date createDate)
	{
		this.createDate = createDate;
	}

	public void setPastDate(Date pastDate)
	{
		this.pastDate = pastDate;
	}

	public void setType(VerifyType type)
	{
		this.type = type;
	}

	public void setValid(BoolValue valid)
	{
		this.valid = valid;
	}

	public void setValue(String value)
	{
		this.value = value;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	

}
